{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Architecture"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "tags": [
     "remove-cell"
    ]
   },
   "outputs": [],
   "source": [
    "import pathlib\n",
    "import re\n",
    "\n",
    "import graphviz\n",
    "import IPython\n",
    "\n",
    "\n",
    "@IPython.core.magic.register_line_cell_magic\n",
    "def dot(line, cell=None):\n",
    "    src = graphviz.Source(pathlib.Path(line).read_text() if line else cell)._repr_svg_()\n",
    "    src = re.sub(r\"<svg (.*)viewBox\", \"<svg viewBox\", src, flags=re.M | re.DOTALL)\n",
    "    return IPython.display.SVG(data=src)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### As-Is\n",
    "\n",
    "These are how we _think_ everything works in the current `main` branch."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Front End"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "tags": [
     "remove-input"
    ]
   },
   "outputs": [],
   "source": [
    "%dot dot/as-is/frontend.dot"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### **Positioning system**\n",
    "\n",
    "![positioning system](images/coordinate_system.png)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Back End"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "tags": [
     "remove-input"
    ]
   },
   "outputs": [],
   "source": [
    "%dot dot/as-is/backend.dot"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Proposals\n",
    "\n",
    "Some fragments of how the architecture could change in the future, and why (or\n",
    "why not) they might be a good idea."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- Reorganize client source with lerna and typescript projects [#76][]\n",
    "- Add DiagnosticsManager, refactor DiagnosticPanel [#176][]\n",
    "- Multiple sources of LSP messages on frontend and backend [#184][]\n",
    "- Formalize and extend language transclusion [#191][]\n",
    "\n",
    "[#76]: https://github.com/jupyter-lsp/jupyterlab-lsp/issues/76\n",
    "[#176]: https://github.com/jupyter-lsp/jupyterlab-lsp/issues/176\n",
    "[#184]: https://github.com/jupyter-lsp/jupyterlab-lsp/issues/184\n",
    "[#191]: https://github.com/jupyter-lsp/jupyterlab-lsp/issues/191"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.4"
  },
  "widgets": {
   "application/vnd.jupyter.widget-state+json": {
    "state": {},
    "version_major": 2,
    "version_minor": 0
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
